package com.cy.device.rpc.model;

import com.cy.swpc.common.systemManage.po.Device;

import java.util.HashMap;
import java.util.Map;

public class DeviceWithProperty extends Device {
    /**
     * 动态属性
     */
    private Map<String, String> propertyMap = new HashMap<>();

    /**
     * 获取单个属性
     */
    public String getProperty(String propertyCode) {
        return this.propertyMap.get(propertyCode);
    }

    public void setProperty(String propertyCode, String propertyValue) {
        this.propertyMap.put(propertyCode, propertyValue);
    }

    public Integer getPropertyInt(String propertyCode) {
        return Integer.valueOf(this.propertyMap.get(propertyCode));
    }

    public Boolean getPropertyBool(String propertyCode) {
        return Boolean.valueOf(this.propertyMap.get(propertyCode));
    }

    public Map<String, String> getPropertyMap() {
        return propertyMap;
    }

    public void setPropertyMap(Map<String, String> propertyMap) {
        this.propertyMap = propertyMap;
    }
}